<template>
    <div class="header-container">
        <div class="header-logo">
            <img src="../assets/images/双碳管理系统logo.png">
        </div>
        <div class="l-content">
            <!-- <el-button style="margin-right: 20px;" @click="handleMenu" icon="el-icon-menu" size="mini"></el-button> -->
            <!-- 面包屑 -->
            <!-- <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item v-for="item in tags" :key="item.path" :to="{ path: item.path }">{{ item.label }}</el-breadcrumb-item>
            </el-breadcrumb> -->
        </div>
        <div class="r-content">
            <span class="time">{{ dateFormat(date) }}</span>
            <el-dropdown>
                <span class="el-dropdown-link">
                    <img class="user" src="../assets/images/avatar04.png" alt="">
                    <b>登录用户</b>
                </span>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item @click.native="userSeting">个人设置</el-dropdown-item>
                    <el-dropdown-item @click.native="logoutSubmit">退出登录</el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </div>
    </div>
</template>

<script>
import { mapState } from 'vuex'
// import { logout } from '@/api'
import Cookies from 'js-cookie'

export default {
    name: 'CommonHeader',
    data() {
        return {
            date: new Date()
        };
    },
    methods: {
        //  修改菜单栏展开 / 收起状态
        handleMenu() {
            this.$store.commit('collapsMenu')
        },
        //  注销登录
        logoutSubmit() {
        },
        dateFormat(time) {
        },
        //  用户
        userSeting() {
        }
    },
    computed: {
        ...mapState({ tags: state => state.tab.tabsList }),
    },
    mounted() {
    },
    beforeDestroy() {
    }
}
</script>

<style lang="less" scoped>
.header-container {
    padding: 0 20px;
    // background-color: rgb(54, 61, 64);
    background-color: #1890ff;
    // background-color: #fff;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .header-logo {
        display: flex;
        align-items: center;
    }

    .header-logo img {
        height: 50px;
    }

    .text {
        color: #fff;
        font-size: 14px;
        margin-left: 10px;
    }

    .r-content {
        .user {
            width: 40px;
            height: 40px;
            border-radius: 50%;
        }

        b {
            position: relative;
            top: -15px;
            left: 5px;
            color: #fff;
        }

        .time {
            position: relative;
            top: -12px;
            left: -15px;
            color: #fff;
            // font-size: 20px;
        }
    }

    .l-content {
        display: flex;
        align-items: center;

        /deep/.el-breadcrumb__item {
            .el-breadcrumb__inner {
                font-weight: normal;

                &.is-link {
                    color: #666;
                }
            }

            &:last-child {
                .el-breadcrumb__inner {
                    color: #fff;
                }
            }
        }
    }
}
</style>>